#pragma once
#include "QRSWidgetBase.h"

#include "Render/QIVtkSelectionPipeline.h"
#include <vtkSmartPointer.h>
#include "FeatureShape/ShapeOperation.h"

class MainWindow;
class ShapeOperation;

class CreateBaseWidget : public QRSWidgetBase
{
public:
	CreateBaseWidget(MainWindow* inMainWindow, ShapeOperation* inOperation = nullptr, QWidget* parent = nullptr);
	virtual ~CreateBaseWidget();
protected:
	// 这里声明为虚函数是为了让子类可以bind，不然的话会报 can not access protected member
	virtual void onConfirm();
	virtual void onApply();

	virtual void closeEvent(QCloseEvent* event) override;
	virtual ShapeOperation* GetOperation() = 0;
	virtual void GenerateFeatureShapeForCacheActor() = 0;
	virtual void OnPickPosition(const gp_Pnt& inPosition) = 0;
	virtual void Reset();

	void onLeftButtonDown();
	void ConfirmActorCreate();
protected:

	Handle(QIVtkSelectionPipeline) cacheActor;
};

